Optimal. Leaf size=298 \[ \frac{b d^4 \left (3 a^2 (3-n)+b^2 (2-n)\right ) \cos (e+f x) (d \csc (e+f x))^{n-4} \, _2F_1\left (\frac{1}{2},\frac{4-n}{2};\frac{6-n}{2};\sin ^2(e+f x)\right )}{f (2-n) (4-n) \sqrt{\cos ^2(e+f x)}}+\frac{a d^3 \left (a^2 (2-n)+3 b^2 (1-n)\right ) \cos (e+f x) (d \csc (e+f x))^{n-3} \, _2F_1\left (\frac{1}{2},\frac{3-n}{2};\frac{5-n}{2};\sin ^2(e+f x)\right )}{f (1-n) (3-n) \sqrt{\cos ^2(e+f x)}}+\frac{a^2 b d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{n-3}}{f (1-n) (2-n)}+\frac{a^2 d^3 \cot (e+f x) (a \csc (e+f x)+b) (d \csc (e+f x))^{n-3}}{f (1-n)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.565934, antiderivative size = 298, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 6, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.261, Rules used = {3238, 3842, 4047, 3772, 2643, 4046} \[ \frac{b d^4 \left (3 a^2 (3-n)+b^2 (2-n)\right ) \cos (e+f x) (d \csc (e+f x))^{n-4} \, _2F_1\left (\frac{1}{2},\frac{4-n}{2};\frac{6-n}{2};\sin ^2(e+f x)\right )}{f (2-n) (4-n) \sqrt{\cos ^2(e+f x)}}+\frac{a d^3 \left (a^2 (2-n)+3 b^2 (1-n)\right ) \cos (e+f x) (d \csc (e+f x))^{n-3} \, _2F_1\left (\frac{1}{2},\frac{3-n}{2};\frac{5-n}{2};\sin ^2(e+f x)\right )}{f (1-n) (3-n) \sqrt{\cos ^2(e+f x)}}+\frac{a^2 b d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{n-3}}{f (1-n) (2-n)}+\frac{a^2 d^3 \cot (e+f x) (a \csc (e+f x)+b) (d \csc (e+f x))^{n-3}}{f (1-n)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3238
Rule 3842
Rule 4047
Rule 3772
Rule 2643
Rule 4046
Rubi steps
\begin{align*} \int (d \csc (e+f x))^n (a+b \sin (e+f x))^3 \, dx &=d^3 \int (d \csc (e+f x))^{-3+n} (b+a \csc (e+f x))^3 \, dx\\ &=\frac{a^2 d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} (b+a \csc (e+f x))}{f (1-n)}-\frac{d^2 \int (d \csc (e+f x))^{-3+n} \left (-b d \left (b^2 (1-n)+a^2 (3-n)\right )-a d \left (3 b^2 (1-n)+a^2 (2-n)\right ) \csc (e+f x)-a^2 b d (1-2 n) \csc ^2(e+f x)\right ) \, dx}{1-n}\\ &=\frac{a^2 d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} (b+a \csc (e+f x))}{f (1-n)}-\frac{d^2 \int (d \csc (e+f x))^{-3+n} \left (-b d \left (b^2 (1-n)+a^2 (3-n)\right )-a^2 b d (1-2 n) \csc ^2(e+f x)\right ) \, dx}{1-n}+\frac{\left (a d^2 \left (3 b^2 (1-n)+a^2 (2-n)\right )\right ) \int (d \csc (e+f x))^{-2+n} \, dx}{1-n}\\ &=\frac{a^2 b d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{-3+n}}{f (1-n) (2-n)}+\frac{a^2 d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} (b+a \csc (e+f x))}{f (1-n)}+\frac{\left (b d^3 \left (b^2 (2-n)+3 a^2 (3-n)\right )\right ) \int (d \csc (e+f x))^{-3+n} \, dx}{2-n}+\frac{\left (a d^2 \left (3 b^2 (1-n)+a^2 (2-n)\right ) (d \csc (e+f x))^n \left (\frac{\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac{\sin (e+f x)}{d}\right )^{2-n} \, dx}{1-n}\\ &=\frac{a^2 b d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{-3+n}}{f (1-n) (2-n)}+\frac{a^2 d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} (b+a \csc (e+f x))}{f (1-n)}+\frac{a \left (3 b^2 (1-n)+a^2 (2-n)\right ) \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{3-n}{2};\frac{5-n}{2};\sin ^2(e+f x)\right ) \sin ^3(e+f x)}{f (1-n) (3-n) \sqrt{\cos ^2(e+f x)}}+\frac{\left (b d^3 \left (b^2 (2-n)+3 a^2 (3-n)\right ) (d \csc (e+f x))^n \left (\frac{\sin (e+f x)}{d}\right )^n\right ) \int \left (\frac{\sin (e+f x)}{d}\right )^{3-n} \, dx}{2-n}\\ &=\frac{a^2 b d^3 (1-2 n) \cot (e+f x) (d \csc (e+f x))^{-3+n}}{f (1-n) (2-n)}+\frac{a^2 d^3 \cot (e+f x) (d \csc (e+f x))^{-3+n} (b+a \csc (e+f x))}{f (1-n)}+\frac{a \left (3 b^2 (1-n)+a^2 (2-n)\right ) \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{3-n}{2};\frac{5-n}{2};\sin ^2(e+f x)\right ) \sin ^3(e+f x)}{f (1-n) (3-n) \sqrt{\cos ^2(e+f x)}}+\frac{b \left (b^2 (2-n)+3 a^2 (3-n)\right ) \cos (e+f x) (d \csc (e+f x))^n \, _2F_1\left (\frac{1}{2},\frac{4-n}{2};\frac{6-n}{2};\sin ^2(e+f x)\right ) \sin ^4(e+f x)}{f (2-n) (4-n) \sqrt{\cos ^2(e+f x)}}\\ \end{align*}
Mathematica [A] time = 0.543765, size = 167, normalized size = 0.56 \[ -\frac{d \cos (e+f x) \sin ^2(e+f x)^{\frac{n-1}{2}} (d \csc (e+f x))^{n-1} \left (b \sqrt{\sin ^2(e+f x)} \csc (e+f x) \left (3 a^2 \, _2F_1\left (\frac{1}{2},\frac{n}{2};\frac{3}{2};\cos ^2(e+f x)\right )+b^2 \, _2F_1\left (\frac{1}{2},\frac{n-2}{2};\frac{3}{2};\cos ^2(e+f x)\right )\right )+a^3 \, _2F_1\left (\frac{1}{2},\frac{n+1}{2};\frac{3}{2};\cos ^2(e+f x)\right )+3 a b^2 \, _2F_1\left (\frac{1}{2},\frac{n-1}{2};\frac{3}{2};\cos ^2(e+f x)\right )\right )}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 2.937, size = 0, normalized size = 0. \begin{align*} \int \left ( d\csc \left ( fx+e \right ) \right ) ^{n} \left ( a+b\sin \left ( fx+e \right ) \right ) ^{3}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sin \left (f x + e\right ) + a\right )}^{3} \left (d \csc \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (-{\left (3 \, a b^{2} \cos \left (f x + e\right )^{2} - a^{3} - 3 \, a b^{2} +{\left (b^{3} \cos \left (f x + e\right )^{2} - 3 \, a^{2} b - b^{3}\right )} \sin \left (f x + e\right )\right )} \left (d \csc \left (f x + e\right )\right )^{n}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (d \csc{\left (e + f x \right )}\right )^{n} \left (a + b \sin{\left (e + f x \right )}\right )^{3}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sin \left (f x + e\right ) + a\right )}^{3} \left (d \csc \left (f x + e\right )\right )^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]